          
          
         
          var originalWidth = consultWidth = window.innerWidth;
          var watchScroll = null;
          var toTop = null;
          var linkJumpCount = 3;
          var linkHref;
          var beginningDelay = 0;
          var animateDelayCount = 4000;
          var indexHeaderSwiper;
          //var watchBrowse = null;
          var menuBtmToTop = $('header .fluid')[0].getBoundingClientRect().top + $('header .fluid')[0].offsetHeight;
          function countDown(){
                linkJumpCount -= 1;
               
                //linkJumpCount=0时，跳转页面
                if(linkJumpCount <= 0){
                    location.href = linkHref;
                }

                //每秒执行一次,showTime()
                setTimeout("countDown()",1000);
            }
            //禁止滚动
            function bodyScroll(event) {
                　event.preventDefault();
            }
            //内容高度是否小于屏幕高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            function changeBtnTip(){
                flip = !flip; 
                if(!flip){
                    $('header .sonMenuPalace').removeClass('show');
                    if($('header .sonMenuPalace nav').html()){
                        $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                    }
                    $('header .navSide>nav>div').removeClass('over');
                }
                if($('header .navSide')[0].className.indexOf('menu') >= 0){
                    $('header .navSide').removeClass('menu');
                    $('header .navSide').addClass('back');
                }else{
                    $('header .navSide').removeClass('back');
                    $('header .navSide').addClass('menu');
                }
            }
            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    return true;
                }else{
                    return false;
                }
            }
            //返回顶部
            function windowToTop(){
                clearInterval(toTop);
                toTop = setInterval(function(){
                    var current = document.documentElement.scrollTop || document.body.scrollTop;
                    var val = Math.ceil(current / 10);
                    var newScroll = current - val;
                    if(newScroll <= 0){
                        document.documentElement.scrollTop = document.body.scrollTop = 0;
                        clearInterval(toTop);
                        toTop = null
                    }else{
                        document.documentElement.scrollTop = document.body.scrollTop = newScroll;
                    }
                    
                    
                },10);
                
            }
            
            $(document).ready(function(){
                    browserRedirect(); 

                    if(!sessionStorage.first || performance.navigation.type == 1){
                        sessionStorage.setItem('first',true);
                        setTimeout(function(){
                            $('body').css('overflow-y','auto');
                        },2000);

                        setTimeout(function(){
                            
                            $('.beginning').addClass('first');
                            $('.container').addClass('appear');
                            
                        },50)
                        
                        setTimeout(function(){
                            $('.cutLetter').addClass('appear');
                        },65)
                        
                        setTimeout(function(){
                            
                            $('.cutLetter').addClass('frozen');
                        },80)
                    }
                    else{
                    //else if(window.history.length > 2 || performance.navigation.type != 1){  
                        console.log('else');
                        $('.cutLetter').css('display','none');
                        $('.beginning').addClass('basic');
                        $('.beginning').addClass('enter');
                        setTimeout(function(){
                            $('.container').addClass('appear');
                        },20)
                        setTimeout(function(){
                            $('body').css('overflow-y','auto');
                        },990);
                        animateDelayCount = 1700;
                    }
                    if(indexHeaderSwiper){
                        setTimeout(function(){
                            indexHeaderSwiper.autoplay.start();
                        },animateDelayCount);
                    }

                    if(!sessionStorage.firstLink){
                        sessionStorage.firstLink = window.location.href;
                    }
                    console.log($('.mobileDevice').length);
                    setTimeout(checkContnHeight,10);
                    $('a').click(function(e){
                            linkHref = $(this).attr('href');
                            if(linkHref.indexOf('pid') >= 0){
                                sessionStorage.canBack = true;
                            }
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            if((!$(this).siblings('.sonMenu').length && window.innerWidth <= 1200) || window.innerWidth > 1200){
                                console.log('time');
                                $('.beginning').addClass('leave');
                                setTimeout(function(){
                                    $('body').css('overflow-y','hidden');
                                },990);
                                countDown();
                            }
                    })
                    /*$('*').click(function(ev){
                        var oEvent = ev || event;
                        oEvent.cancelBubble = true;
                        oEvent.stopPropagation();
                        if($(this)[0] != $('header .navSide .navBtn')[0] || $(this)[0] != $('header')[0] || !$(this).parents('.navBtn').length){
                            if(!$(this).parents('header').length){
                                if($('header .navSide.back').length){
                                    $('header .navSide .navBtn *').click();
                                }
                            }
                        }
                    })*/
                    $('header .pcMenu .menuBtn').click(function(){
                        
                        if($('header .pcMenu .nav')[0].className.indexOf('appear') >= 0){
                            var scrollTop = Math.abs(parseFloat($('body')[0].style.top));
                            $('header .pcMenu .nav').removeClass('appear');  
                            $('html').removeClass('noScroll');
                            $('body')[0].style.top = '';
                            console.log(scrollTop);
                            document.documentElement.scrollTop = document.body.scrollTop = scrollTop;
                        }else{
                            var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                            $('header .pcMenu .nav').addClass('appear');
                            $('html').addClass('noScroll');
                            $('body')[0].style.top = '-' + scrollTop + 'px';
                        }
                        
                        
                        
                    })
                    $('header .pcMenu .nav ul li .fNav').click(function(){
                        
                        if($(this).next()[0].offsetHeight){
                                $(this).next()[0].style.height = '0px';
                                $(this).removeClass('flip');
                        }else{
                                $(this).next()[0].style.height = $(this).next().find('.box')[0].offsetHeight + 'px';
                                $(this).addClass('flip');
                        }
                        
                    })

                    $('footer .footage .support .vxQQ .sign .vx').mouseenter(function(){
                            $('footer .footage .support .vxQQ .code').addClass('over');
                            $('footer .footage .support .vxQQ .sign .triangle').addClass('over');
                    })
                    $('footer .footage .support .vxQQ .sign .vx').mouseleave(function(){
                            $('footer .footage .support .vxQQ .code').removeClass('over');
                            $('footer .footage .support .vxQQ .sign .triangle').removeClass('over');
                    })
                    $('.windowSide .toTop').click(windowToTop);
                    watchScroll = setInterval(function(){
                        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                        if(scrollTop >= window.innerHeight * 0.75 && $('.windowSide')[0].className.indexOf('show') < 0){
                            $('.windowSide').addClass('show')
                            
                        }else if(scrollTop < window.innerHeight * 0.75 && $('.windowSide')[0].className.indexOf('show') >= 0){
                            $('.windowSide').removeClass('show');
                            
                        }
                    })
            })

            

        